Skip to content

Conversation

hannah-heywa
Copy link

with_exposed_ports for ports != 5432 breaks -- the internal port is always 5432, we're just binding to different host ports.

with_exposed_ports for ports != 5432 breaks -- the internal port is always 5432, we're just binding to different host ports.
@hannah-heywa hannah-heywa changed the title Use with_bind_ports for postgres container fix(postgres): Use with_bind_ports for postgres container Aug 3, 2025
@alexanderankin
Copy link
Member

what are you trying to do and what is happening instead? testcontainers generates a random port - this behavior is ideal for tests, so that you can run tests in parallel, or even you can run the tests on a system where postgres is running on the default port (a random port wont conflict). that is the intended behavior.

if you can share some details about what you are doing, i can help you figure out how to use testcontainers in your workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants